package com.example.testproj.suspend;

import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;

import com.example.testproj.R;

public class SuspendActivity extends AppCompatActivity implements View.OnClickListener {
    private Button mStartBtn,mEndBtn;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_remove_view);

        mStartBtn= (Button) findViewById(R.id.btn_start_service);
        mEndBtn= (Button) findViewById(R.id.btn_stop_service);

        mStartBtn.setOnClickListener(this);
        mEndBtn.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        Intent intent=new Intent(this,SuspendService.class);
        switch (v.getId()){
            case R.id.btn_start_service:
                startService(intent);
                break;
            case R.id.btn_stop_service:
                stopService(intent);
                break;
        }
    }
}
